﻿<!--
Majesty of Omega - The next evolution of macro management space strategy

Copyright 2007-2009 André Claaßen

This file is protected by the terms and conditions of the
Microsoft Community License (Ms-CL 1.1), a copy of which should
have been distributed along with this software. If not,
you may find the license information at the following URL:

http://www.microsoft.com/resources/sharedsource/licensingbasics/communitylicense.mspx
-->
<Page
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	x:Class="Majesty_of_Omega.GUI.Pages.Game.Research.ResearchPage"
	x:Name="Page"
	WindowTitle="Research Screen"
	FlowDirection="LeftToRight"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:Controls="clr-namespace:Majesty_of_Omega.GUI.Controls" 
	mc:Ignorable="d" 
	MinWidth="800"
	MinHeight="600"
	d:DesignWidth="1282" d:DesignHeight="768"
	xmlns:Parts="clr-namespace:Majesty_of_Omega.GUI.Pages.Game.Research.Parts"
	xmlns:Majesty_of_Omega_GUI_ValueConverters="clr-namespace:Majesty_of_Omega.GUI.ValueConverters"
	xmlns:Majesty_of_Omega_GUI_Controller="clr-namespace:Majesty_of_Omega.GUI.Controller"
    Loaded="ResearchPage_OnLoaded"
	>

    <Page.Resources>
        <Majesty_of_Omega_GUI_ValueConverters:TechIconToImageConverter x:Key="TechIconToImageConverter"/>
        <DataTemplate x:Key="TechApplicationDataTemplate">
            <Grid Width="Auto" Height="Auto">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="94.456"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image x:Name="image" HorizontalAlignment="Stretch" Height="Auto" OpacityMask="#FFFFFFFF" Source="{Binding Path=IconName, Converter={StaticResource TechIconToImageConverter}, Mode=Default}" Width="Auto" Margin="8,8,8,8"/>
                <StackPanel Height="Auto" Grid.Column="1" >
                    <TextBlock x:Name="textBlock" TextWrapping="Wrap" FontWeight="Bold" Margin="0,0,0,8" Text="{Binding Path=Name, Mode=Default}"/>
                    <TextBlock x:Name="textBlock1" TextWrapping="Wrap" FontWeight="Normal" Text="Field required:"/>
                    <ItemsControl TextBlock.FontSize="12" ItemsSource="{Binding Path=TechFieldDependencies, Mode=Default}" />
                </StackPanel>
            </Grid>
        </DataTemplate>

        <!-- This Data Template is bound to  -->
        <DataTemplate x:Key="TechSchoolDataTemplate">
            <DataTemplate.Resources>
                <Storyboard x:Key="StoryboardHighlightFlash">
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Flasher" Storyboard.TargetProperty="(UIElement.Visibility)">
                        <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Flasher" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                        <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF84A9F9"/>
                        <SplineColorKeyFrame KeyTime="00:00:01" Value="#FF000B7E"/>
                        <SplineColorKeyFrame KeyTime="00:00:02" Value="#FF84A9F9"/>
                    </ColorAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:02" Duration="00:00:00.0010000" Storyboard.TargetName="Flasher" Storyboard.TargetProperty="(UIElement.Visibility)">
                        <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Hidden}"/>
                    </ObjectAnimationUsingKeyFrames>
                </Storyboard>
            </DataTemplate.Resources>
            <Grid x:Name="GridTechschoolItem" HorizontalAlignment="Stretch" Opacity="1" Height="53.96" >
                <Rectangle x:Name="Flasher" StrokeThickness="1" Margin="0,4.333,0,4" Stroke="{x:Null}" Visibility="Hidden">
                    <Rectangle.Fill>
                        <SolidColorBrush Color="#FF84A9F9"/>
                    </Rectangle.Fill>
                </Rectangle>
                <StackPanel Orientation="Vertical" VerticalAlignment="Top">
                    <TextBlock x:Name="textBlock" Width="Auto" Height="Auto" TextWrapping="Wrap" Text="{Binding Path=Name, Mode=Default}" Foreground="#FFFFFFFF" Margin="8,5,8,0"/>
                    <Controls:MooPercentageBar x:Name="PercentageSlider" Width="Auto" Height="Auto" Margin="8,2,8,2" VerticalAlignment="Top" 
            			PercentageValue="{Binding Path=Percentage, Mode=TwoWay}" />
                </StackPanel>
            </Grid>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Path=Highlight}" Value="true">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard Storyboard="{StaticResource StoryboardHighlightFlash}"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
        <DataTemplate x:Key="TechFieldDataTemplate">
            <DataTemplate.Resources>
                <Storyboard x:Key="StoryboardHighlightFlash">
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Flasher" Storyboard.TargetProperty="(UIElement.Visibility)">
                        <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Flasher" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                        <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF84A9F9"/>
                        <SplineColorKeyFrame KeyTime="00:00:01" Value="#FF000B7E"/>
                        <SplineColorKeyFrame KeyTime="00:00:02" Value="#FF84A9F9"/>
                    </ColorAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:02" Duration="00:00:00.0010000" Storyboard.TargetName="Flasher" Storyboard.TargetProperty="(UIElement.Visibility)">
                        <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Hidden}"/>
                    </ObjectAnimationUsingKeyFrames>
                </Storyboard>
            </DataTemplate.Resources>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Path=Highlight}" Value="true">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard Storyboard="{StaticResource StoryboardHighlightFlash}"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>
            </DataTemplate.Triggers>
            <Grid Width="Auto" Margin="0,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="61.2619999999999"/>
                    <ColumnDefinition Width="74.0000000000001"/>
                    <ColumnDefinition Width="0.742*"/>
                    <ColumnDefinition Width="0.258*"/>
                </Grid.ColumnDefinitions>
                <Rectangle x:Name="Flasher" Visibility="Hidden"  Stroke="{x:Null}" HorizontalAlignment="Stretch" Width="Auto" Grid.ColumnSpan="4" Grid.RowSpan="1">
                    <Rectangle.Fill>
                        <SolidColorBrush Color="#FF84A9F9"/>
                    </Rectangle.Fill>
                </Rectangle>
                <Image x:Name="image" HorizontalAlignment="Stretch" Margin="8,0,0,4.52" Width="Auto" Source="{Binding Path=ResearchItem.Icon, Converter={StaticResource TechIconToImageConverter}, Mode=Default}"/>
                <TextBlock x:Name="textBlock" Margin="8,0,0,0" Text="{Binding Path=Name, Mode=Default}" TextWrapping="Wrap" VerticalAlignment="Center" Foreground="#FF000000" Grid.Column="1" Grid.ColumnSpan="1"/>
                <Controls:MooPercentageBar x:Name="PercentageSlider" PercentageValue="{Binding Path=Percentage, Mode=TwoWay}"  HorizontalAlignment="Stretch" Margin="0,4,0,4" VerticalAlignment="Center" Grid.Column="2" Grid.ColumnSpan="1"/>
                <TextBlock x:Name="textBlock1" TextWrapping="Wrap" VerticalAlignment="Center" Foreground="#FFFFFFFF" d:LayoutOverrides="Height" Grid.Column="3" Text="{Binding Path=ResearchItem.TechLevel, Converter={StaticResource FormattingStringConverter}, ConverterParameter=Level \{0:D\}, Mode=Default}" Margin="8,0,8,0"/>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="ResearchItemTemplate">
            <StackPanel Orientation="Horizontal">
                <Image x:Name="image" HorizontalAlignment="Stretch" Height="32" OpacityMask="#FFFFFFFF" Source="{Binding Path=Technology.IconName, Converter={StaticResource TechIconToImageConverter}, Mode=Default}" Width="64" Margin="0,8,0,8"/>
                <TextBlock x:Name="textBlock" VerticalAlignment="Center" Text="{Binding Path=Technology.Name}" Margin="16,0,0,0" />
            </StackPanel>
        </DataTemplate>

        <DataTemplate x:Key="BudgetAllocationTemplate">
            <Grid Width="Auto" Height="Auto">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="45.916"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="0.658*"/>
                    <RowDefinition Height="0.342*"/>
                </Grid.RowDefinitions>
                <Parts:FundingLevelPart Percentage="{Binding Path=ResearchPercentage}" Grid.RowSpan="1" Grid.ColumnSpan="1" />
                <TextBlock x:Name="textBlock" Text="{Binding Path=BudgetFundingLevelInfo.Label}" Grid.RowSpan="1" Grid.ColumnSpan="2" Grid.Row="1" HorizontalAlignment="Center" Margin="0,4,0,0" />
                <TextBlock x:Name="textBlock1" Text="{Binding Path=ResearchPercentage}" Grid.RowSpan="1" Grid.ColumnSpan="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" />
            </Grid>
        </DataTemplate>
        <DataTemplate x:Key="TurnCostTemplate">
            <Grid Width="120">
                <TextBlock x:Name="textBlock" HorizontalAlignment="Center" Text="{Binding Path=TurnCost}" />
            </Grid>
        </DataTemplate>
        <DataTemplate x:Key="TurnRemainingTemplate">
            <Grid Width="120">
                <TextBlock x:Name="textBlock" HorizontalAlignment="Center" Text="{Binding Path=TurnsRemaining}" />
            </Grid>
        </DataTemplate>

        <ObjectDataProvider x:Key="ResearchPageControllerDS" ObjectType="{x:Type Majesty_of_Omega_GUI_Controller:ResearchPageController}" d:IsDataSource="True"/>

        <ControlTemplate x:Key="TechSchoolItemControlTemplate" TargetType="{x:Type ListViewItem}" >
            <Grid SnapsToDevicePixels="true" HorizontalAlignment="Stretch" >
                <Grid x:Name="Border" Visibility="Hidden"  Margin="0,0,-17,0" >
                    <Grid.Background>
                        <SolidColorBrush Color="{DynamicResource FieldOfResearchColor}"/>
                    </Grid.Background>
                    <Path Stretch="Fill" Stroke="#FFFFFFFF" StrokeThickness="1" Margin="0,0,0.625,0" VerticalAlignment="Top" Height="4.333" Data="M2.1288168,2.0259808 L119.55821,2.4009782 120.36737,1.5259843 120.72138,-0.93233186"/>
                    <Path Stretch="Fill" Stroke="#FFFFFFFF" StrokeThickness="1" Height="4.333" Data="M2.1288168,2.0259808 L119.55821,2.4009782 120.36737,1.5259843 120.72138,-0.93233186" Margin="0.625,0,0,0" VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5">
                        <Path.RenderTransform>
                            <ScaleTransform ScaleX="1" ScaleY="-1"/>
                        </Path.RenderTransform>
                    </Path>
                </Grid>
                <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            </Grid>
            <ControlTemplate.Triggers>
                <!-- Change IsSelected SelectedBackgroundBrush to set the selection color for the items -->
                <Trigger Property="IsSelected" Value="true" >
                    <Setter Property="Visibility" Value="Visible" TargetName="Border"/>
                </Trigger>

                <!--<Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Visibility" Value="Hidden"/>
                            </Trigger>-->
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <!-- The TechSchoolItemContainerStyle renders the layout for every Selected or unseleced TechSchool-Item
        -->
        <Style x:Key="TechSchoolItemContainerStyle" TargetType="{x:Type ListViewItem}">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Template" Value="{DynamicResource TechSchoolItemControlTemplate}"/>
        </Style>
    </Page.Resources>

    <Grid x:Name="LayoutRoot" Background="#FF000000" 
          DataContext="{Binding Mode=OneWay, Source={StaticResource ResearchPageControllerDS}}" >
        <TextBlock x:Name="textBlock" Text="Technology"  Style="{DynamicResource SubWindowTitleStyle}" d:LayoutOverrides="Width" />
        <Controls:MooTabControl x:Name="mooTabControl" Margin="21,21.89,23,8" HorizontalAlignment="Stretch" SelectedIndex="2" >

            <!-- T e c h n o l o g y     M a t r i x ++++++++++++++++++++++++++++++++++++++++ -->

            <Controls:MooTabItem Header="Tech Matrix" >
                <Parts:TechnologyMatrixPart x:Name="TechnologyMatrix" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
            </Controls:MooTabItem>

            <!-- A p p l i e d    T e c h n o l o g y +++++++++++++++++++++++++++++++++++++++ -->

            <Controls:MooTabItem Header="Applied" >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.36*"/>
                        <ColumnDefinition Width="0.288*"/>
                        <ColumnDefinition Width="0.352*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.561*"/>
                        <RowDefinition Height="0.439*"/>
                    </Grid.RowDefinitions>
                    <Parts:ResearchPointPart Grid.Row="1" Margin="16,8,8,16.1" Grid.ColumnSpan="1" FundamentalResearch="{Binding Path=FundamentalResearch, Mode=Default}" AppliedResearch="{Binding Path=AppliedResearch, Mode=Default}"/>
                    <Controls:SetupPanelControl Header="Current Research" Style="{DynamicResource SubPanelLook}" VerticalAlignment="Stretch" Margin="16,16,8,8" Grid.ColumnSpan="2">
                        <ListView x:Name="CurrentResearchListView" 
                                  Width="Auto" Height="Auto" 
                                  IsSynchronizedWithCurrentItem="True" 
                                  ItemsSource="{Binding Path=CurrentAppliedTechnologiesList, Mode=OneWay}" 
                                  SelectionMode="Single" 
                                  SelectedItem="{Binding Path=SelectedAppliedResearch, Mode=Default}" 
								  Style="{DynamicResource MooListViewStyle}" Margin="16,16,8,8" 
                                  >
                            <ListView.View>
                                <GridView ColumnHeaderContainerStyle="{StaticResource ListViewHeaderStyle}"  >
                                    <GridViewColumn Width="Auto" Header="Research Item"  CellTemplate="{StaticResource ResearchItemTemplate}" />
                                    <GridViewColumn Width="120" Header="Turn Cost" CellTemplate="{StaticResource TurnCostTemplate}" />
                                    <GridViewColumn Width="120" Header="Turns Remaining" 
                                                    CellTemplate="{StaticResource TurnRemainingTemplate }"  />
                                    <GridViewColumn Width="Auto" Header="Budget Allocation" CellTemplate="{StaticResource BudgetAllocationTemplate}" />
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </Controls:SetupPanelControl>
                    <Parts:TechnicalInformationPart FundingVisible="true"  
                                                    Grid.Column="2" Margin="8,16,16,8" 
                                                    DataContext="{Binding Path=SelectedAppliedResearch.Technology, Mode=Default}" 
                                                    FundingLevel="{Binding Path=SelectedAppliedResearchFunding, Mode=TwoWay, Source={StaticResource ResearchPageControllerDS}}"/>
                    <Controls:SetupPanelControl Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Header="Available Areas of Research" Margin="8,8,16,14" Style="{DynamicResource SubPanelLook}" Location="Right">
                        <Grid Width="Auto" Height="Auto">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="0.7*"/>
                                <ColumnDefinition Width="0.3*"/>
                            </Grid.ColumnDefinitions>
                            <Grid Grid.Column="1">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="0.225*"/>
                                    <RowDefinition Height="0.517*"/>
                                    <RowDefinition Height="0.258*"/>
                                </Grid.RowDefinitions>
                                <TextBlock x:Name="textBlock1" Width="Auto" Height="Auto" FontSize="18" FontWeight="Bold" 
											Text="{Binding Path=SelectedValue.Technology.Name, ElementName=AvailableResearchListView, Mode=Default}" 
											TextWrapping="Wrap" VerticalAlignment="Center" d:LayoutOverrides="Width" HorizontalAlignment="Center"/>
                                <Image x:Name="image" Source="{Binding Path=SelectedValue.Technology.IconName, Converter={StaticResource TechIconToImageConverter}, ElementName=AvailableResearchListView, Mode=Default}" Stretch="Fill" Grid.Row="1" Margin="16,0,16,0"/>
                                <Button x:Name="button" Style="{DynamicResource GlassButtonStyle}" Content="Add selected Item" Grid.Row="2" VerticalAlignment="Center" Height="34" Margin="16,0,16,0" Click="AddSelectedAvailableResearch_Click"/>
                            </Grid>
                            <ListView x:Name="AvailableResearchListView" 
                                      IsSynchronizedWithCurrentItem="True" 
                                      SelectionMode="Single" 
                                      Style="{DynamicResource MooListViewStyle}" 
                                      ItemsSource="{Binding Path=AvailableAppliedTechnologiesList, Mode=Default}" 
                                      SelectedItem="{Binding Path=SelectedAppliedResearch, Mode=Default}"
                                      >
                                <ListView.View>
                                    <GridView ColumnHeaderContainerStyle="{StaticResource ListViewHeaderStyle}">
                                        <GridViewColumn Width="300" Header="Research Item"  CellTemplate="{StaticResource ResearchItemTemplate}" />
                                        <GridViewColumn Width="120" Header="Turn Cost" CellTemplate="{StaticResource TurnCostTemplate}" />
                                    </GridView>
                                </ListView.View>
                            </ListView>
                        </Grid>
                    </Controls:SetupPanelControl>
                </Grid>
            </Controls:MooTabItem>

            <!-- T h e o r e t i c a l     T e c h n o l o g y ++++++++++++++++++++++++++++++ -->

            <Controls:MooTabItem Header="Theoretical" >
                <Grid ScrollViewer.VerticalScrollBarVisibility="Disabled" x:Name="TheoreticaLayoutGrid">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.545*"/>
                        <RowDefinition Height="142.623"/>
                        <RowDefinition Height="0.455*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.313*"/>
                        <ColumnDefinition Width="0.331*"/>
                        <ColumnDefinition Width="0.356*"/>
                    </Grid.ColumnDefinitions>
                    <Controls:SetupPanelControl x:Name="TechSchoolPanel" Style="{DynamicResource SubPanelLook}" Header="School" Margin="16,16,8,16" VerticalAlignment="Stretch" Height="Auto" Grid.RowSpan="2">
                        <ListView 
                            x:Name="TechSchoolListView"
                            ClipToBounds="False"
                            Width="Auto" Height="Auto" 
							HorizontalContentAlignment="Stretch" 
							VerticalContentAlignment="Top" 
							ItemTemplate="{DynamicResource TechSchoolDataTemplate}" 
							ItemsSource="{Binding Path=TechSchoolResearchList, Mode=Default}" 
                            SelectedIndex="1"
                            SelectedValue="{Binding Path=SelectedTechSchool, Mode=Default}" 
                            SelectionChanged="TechSchoolList_SelectionChanged" 
                            ItemContainerStyle="{DynamicResource TechSchoolItemContainerStyle}" 
							ScrollViewer.CanContentScroll="False" 
							ScrollViewer.VerticalScrollBarVisibility="Disabled" IsTabStop="True">
                            <ListView.Background>
                                <SolidColorBrush Color="{DynamicResource PanelBackgroundColor}"/>
                            </ListView.Background>
                        </ListView>
                    </Controls:SetupPanelControl>
                    <Parts:TechnicalInformationPart Grid.Column="2" Grid.RowSpan="1"  DataContext="{Binding Path=SelectedValue, ElementName=TechAppListView, Mode=Default}" Margin="8,16,16,8" Grid.Row="2" />
                    <Controls:SetupPanelControl x:Name="TechFieldPanel" Style="{DynamicResource SubPanelLook}" Header="Field of Research" Margin="8,16,8,16" Grid.Column="1" Panel.ZIndex="-3" Grid.RowSpan="2">
                        <Controls:SetupPanelControl.Background>
                            <SolidColorBrush Color="{DynamicResource FieldOfResearchColor}"/>
                        </Controls:SetupPanelControl.Background>
                        <ListView x:Name="TechFieldListView" 
                                  ItemTemplate="{DynamicResource TechFieldDataTemplate}" 
                                  ItemsSource="{Binding Path=TechFieldResearchList, Mode=Default}" 
                                  HorizontalContentAlignment="Stretch" 
                                  SelectedIndex="0" 
                                  SelectedValue="{Binding Path=SelectedTechField, Mode=Default}"
                                  Style="{DynamicResource MooListViewStyle}" 
                                  IsTabStop="True">
                            <ListView.Background>
                                <SolidColorBrush Color="{DynamicResource FieldOfResearchColor}"/>
                            </ListView.Background>
                        </ListView>
                    </Controls:SetupPanelControl>
                    <Parts:ResearchPointPart Margin="16,0,8,16" Grid.Row="2" d:LayoutOverrides="HorizontalAlignment, VerticalAlignment" FundamentalResearch="{Binding Path=FundamentalResearch, Mode=Default}" AppliedResearch="{Binding Path=AppliedResearch, Mode=Default}"/>

                    <Controls:SetupPanelControl Style="{DynamicResource SubPanelLook}" Header="Upcoming Possiblities for field of research" Margin="8,8,16,16" Grid.Column="2" Grid.Row="0" Grid.RowSpan="2" Location="Right">
                        <Controls:SetupPanelControl.Background>
                            <SolidColorBrush Color="{DynamicResource TechInfoColor}"/>
                        </Controls:SetupPanelControl.Background>
                        <ListView Width="Auto" Height="Auto" IsSynchronizedWithCurrentItem="True" Background="{x:Null}" ItemTemplate="{DynamicResource TechApplicationDataTemplate}" x:Name="TechAppListView" 
                                  ItemsSource="{Binding Path=UpcomingTechnologies, Mode=Default}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ToolTip="{Binding Path=Description, Mode=Default}" HorizontalContentAlignment="Stretch" IsTabStop="True" />
                    </Controls:SetupPanelControl>
                    <Controls:SetupPanelControl x:Name="TechFieldInfoPanel" Style="{DynamicResource SubPanelLook}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                                                Header="Field of Research Information" Grid.Column="1" Grid.Row="2" Margin="8,8,8,16" 
                                                DataContext="{Binding Path=SelectedValue, ElementName=TechFieldListView, Mode=Default}">
                        <Controls:SetupPanelControl.Background>
                            <SolidColorBrush Color="{DynamicResource FieldOfResearchColor}"/>
                        </Controls:SetupPanelControl.Background>
                        <Grid Width="Auto" Height="Auto">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="0.398*"/>
                                <ColumnDefinition Width="0.329*"/>
                                <ColumnDefinition Width="0.273*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Image x:Name="image1" Source="{Binding Path=ResearchItem.TechField.IconName, Converter={StaticResource TechIconToImageConverter}, Mode=Default}" Stretch="UniformToFill" Grid.RowSpan="3" Grid.Column="3" Margin="4,8,4,0" Width="90" Height="Auto"/>
                            <TextBlock x:Name="textBlock2" Height="Auto" Text="{Binding Path=Name, Mode=Default}" TextWrapping="Wrap" Foreground="#FF000000" Margin="8,4,0,8" FontWeight="Bold" d:LayoutOverrides="Height" Grid.ColumnSpan="1"/>
                            <TextBlock x:Name="textBlock3" Grid.Row="1" Text="Research Spendage" TextWrapping="Wrap" Foreground="#FF000000" Margin="8,4,0,0" Height="Auto" VerticalAlignment="Top" />
                            <TextBlock x:Name="textBlock4" Grid.Row="2" Text="Current technology Level" TextWrapping="Wrap" Foreground="#FF000000" Margin="8,0,0,0" VerticalAlignment="Bottom" Height="Auto" />
                            <TextBlock x:Name="textBlock5" Grid.Row="3" Text="Research done in current level" TextWrapping="Wrap" Foreground="#FF000000" Margin="8,4,0,0" />
                            <TextBlock x:Name="textBlock6" Grid.Row="1" Grid.Column="1" Text="{Binding ResearchItem.CurrentResearchFormatted}" TextWrapping="Wrap" Foreground="#FF000000" Margin="8,4,0,0" Height="15.96" Grid.ColumnSpan="1" VerticalAlignment="Top" />
                            <TextBlock x:Name="textBlock7" Grid.Row="2" Grid.Column="1" Text="{Binding ResearchItem.TechLevel}" TextWrapping="Wrap" Foreground="#FF000000" Margin="8,0,0,0" VerticalAlignment="Bottom" Height="Auto" Grid.ColumnSpan="1" />
                            <DockPanel Margin="8,0,0,4" Grid.Column="1" Grid.ColumnSpan="1" Grid.Row="3">
                                <TextBlock x:Name="textBlock8" Text="{Binding Path=ResearchItem.ResearchDoneFormatted}" TextWrapping="Wrap" Foreground="#FF000000" Width="Auto" Height="Auto" VerticalAlignment="Center" />
                                <ProgressBar Value="{Binding Path=ResearchItem.ProgressInCurrentLevel, Mode=OneWay}"  Width="Auto" Height="20" DockPanel.Dock="Right" HorizontalAlignment="Stretch" Margin="16,0,8,0"/>
                            </DockPanel>
                        </Grid>
                    </Controls:SetupPanelControl>
                    <Grid x:Name="TechSchoolCursor" Height="53.98" Width="31.667" Margin="-15,47.958,0,0" Background="#FF84A9F9" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.ColumnSpan="1" Panel.ZIndex="12" Grid.Column="1" d:LayoutOverrides="HorizontalAlignment" Grid.RowSpan="2">
                        <Path Stretch="Fill" Stroke="#FFFFFFFF" StrokeThickness="1" VerticalAlignment="Top" Height="4.812" Data="M0.27306277,2.4899009 L111.78165,2.5529851 116.37185,1.5113037 116.45944,-1.3840709" Margin="-0.422,-0.452,3.673,0" />
                        <Path Stretch="Fill" Stroke="#FFFFFFFF" StrokeThickness="1" Height="1.323" Data="M-2.8622377,1.9564995 L113.38746,2.1449544 116.28162,1.3339987 116.3726,-1.396972" Margin="-0.485,0,3.672,2.307" VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="-1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="0"/>
                                    <TranslateTransform X="0" Y="-0.20899999999999785"/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </Grid>
            </Controls:MooTabItem>
        </Controls:MooTabControl>
    </Grid>
</Page>